﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AAA.DataSource;
using AAA.Meta.Quote.Data;

namespace AAA.TradeLanguage
{
    public interface IDataAccess
    {
        CurrentTime CurrentTime { get; set; }
        IDataSource DataSource { get; set; }

        string ActiveSymbol { get; set; }

        DateTime Time();
        DateTime Time(int iIndex);
        DateTime Time(string strSymbolId, int iIndex);

        float Open();
        float Open(int iIndex);
        float Open(string strSymbolId, int iIndex);

        float High();
        float High(int iIndex);
        float High(string strSymbolId, int iIndex);


        float Low();
        float Low(int iIndex);
        float Low(string strSymbolId, int iIndex);

        float Close();
        float Close(int iIndex);
        float Close(string strSymbolId, int iIndex);

        float Volume();
        float Volume(int iIndex);
        float Volume(string strSymbolId, int iIndex);

        float Amount();
        float Amount(int iIndex);
        float Amount(string strSymbolId, int iIndex);

        float TickCount();
        float TickCount(int iIndex);
        float TickCount(string strSymbolId, int iIndex);

        int BarNumber();
        int BarNumber(int iIndex);
        int BarNumber(string strSymbolId, int iIndex);

        BarRecord Bar();
        BarRecord Bar(int iIndex);
        BarRecord Bar(string strSymbolId, int iIndex);

        float GetValue(string strFunctionName, int iIndex);

        void SetGlobalVariable(string strKey, float fValue);
        float GetGlobalVariable(string strKey);
        float GetGlobalVariable(string strKey, int iIndex);

        BarCompression BarCompression(string strSymbolName);
        
        void AddBarData(string strSymbolName, BarRecord barRecord);
        void UpdateLastBarData(string strSymbolName, BarRecord barRecord);
    }
}
